// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  var id=event.userInfo.openId;
  const db=cloud.database({
    env: 'cards-2c53b0'
  });
  
  return await db.collection('users').add({
    data: {
      _id: id,
      exp: 0
    }
  })
}